package com.movie.demo.controller;

import com.movie.demo.pojo.Role;
import com.movie.demo.Utlis.result.CommonResult;
import com.movie.demo.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@CrossOrigin
public class RoleController {
    @Autowired
    private RoleService roleService;
    @PostMapping("/role")
    public CommonResult<Role> login(@RequestBody Role role){
        Role roles=roleService.selectRole(role.getId());
        if(roles!=null){
            return CommonResult.success(roles);
        }
        return CommonResult.failed();
    }
}
